<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
    <style>
        *{
            margin: 0;
            padding: 0;
        }
        .box{
            width: 100px;
            height: 100px;
            border: 1px solid skyblue;
            background-color: skyblue;
            transition: all 2s linear 0s;
            animation: shift 5s linear infinite;
        }
        @keyframes shift {
            0% {
                transform: translate(0);

            }
            25% {
                transform: translateX(500px);

            }
            50% {
                transform: translate(500px,500px);

            }
            75%{

                transform: translateY(500px);
            }
            100%{
                transform: translate(0);
            }
        }
        .box:hover{
            width: 500px;

        }
    </style>
<body>
    <div class="box"></div>
</body>
</html>